package com.bw.documents.local.adapter

import com.bw.documents.R
import com.bw.documents.local.entity.LocalDocumentsEntity
import com.bw.quickadapter.BaseQuickAdapter
import com.bw.quickadapter.BaseViewHolder

class LocalDocumentsAdapter : BaseQuickAdapter<LocalDocumentsEntity>(R.layout.item_local_documents) {

    init {
        addItemChildClick(R.id.local_documents_sel_img)
    }

    override fun convert(holder: BaseViewHolder?, item: LocalDocumentsEntity?) {
        holder!!.let {
            it.setImage(R.id.local_documents_img,R.drawable.icon3)
            it.setText(R.id.local_documents_name_tv,item!!.name)
            it.setText(R.id.local_documents_time_tv,item!!.path)
            if (item.sel){
                it.setImage(R.id.local_documents_sel_img,R.drawable.icon598)
            }else it.setImage(R.id.local_documents_sel_img,R.drawable.icon571)
        }
    }
}